<?php 
class Payfailurelog extends CS_Controller
{
    public function _init()
    {
        $this->load->library('pagination');
        $this->load->model('pay_failure_log_model', 'pay_failure_log');
    }
    
    public function grid($pg = 1)
    {
        $pageNum = 20;
        $num = ($pg-1)*20;
        $config['base_url']    = base_url('payfailurelog/grid');
        $config['total_rows']  = $this->pay_failure_log->total();
    
        $config['uri_segment'] = 3;
        $this->pagination->initialize($config);
        $data['pg_list'] = $this->pagination->create_links();
        $data['page_list'] = $this->pay_failure_log->page_list($pageNum, $num);
        $data['all_rows'] = $config['total_rows'];
        $data['pg_now'] = $pg;
        $this->load->view('payfailurelog/errorlog',$data);
    }
    public function search($pg = 1)
    {
        if (!$this->search_get_validate($this->input->get())) {
            $this->redirect('payfailurelog/grid');
        }
        $pageNum = 20;
        $num = ($pg-1)*20;
        $config['first_url'] = base_url('payfailurelog/search').$this->pageGetParam($this->input->get());
        $config['suffix']    = $this->pageGetParam($this->input->get());
        $config['base_url']  = base_url('payfailurelog/search');
    
        $config['total_rows']  = $this->pay_failure_log->total($this->input->get());
        $config['uri_segment'] = 3;
        $this->pagination->initialize($config);
        $data['pg_list']   = $this->pagination->create_links();
        $data['page_list'] = $this->pay_failure_log->page_list($pageNum, $num, $this->input->get());
    
        $data['all_rows']  = $config['total_rows'];
        $data['pg_now']    = $pg;
        $this->load->view('payfailurelog/errorlog',$data);
    }
}